#!/usr/bin/env python

import pygame,sys,os, pygame._view 
from classes.map_renderer import *

def main(width, height):
  pygame.init()
  screen = pygame.display.set_mode((width,height))
  
  filex = os.path.join('resources', '001-1.tmx')

  background = pygame.Surface((width,height))
  background.fill((0,0,0))
  screen.blit(background, (0,0))
  clock = pygame.time.Clock()
  FPS = 60

  while True:
    #event handling
    for event in pygame.event.get():
      if event.type == pygame.QUIT:
        pygame.quit()
        sys.exit()

    #render
    map_renderer(filex, (width, height), screen)

    
    clock.tick(FPS)

if __name__ == '__main__':
  main(1024,768)
